Skip to content

bridge S10 (#14376): console provisioning — enroll + credential mints shown once, token state, revoke by agent - #14506

Merged
developing-today-fleet[bot] merged 3 commits into
mainfrom
felix/14376-console-provisioning
Nov 24, 2026
Merged

developing-today-fleet[bot] merged 3 commits into
mainfrom
felix/14376-console-provisioning

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Refs #14376

Bridge slice S10: the PM console provisioning surface. A new agent can now be onboarded from the console alone — mint a bootstrap enroll token, hand it off once, watch it close (used / expired / revoked), mint scoped credentials directly, and take tokens back — paired with S4's fleet agent enroll --bootstrap.

What changed

Worker (pkgs/message-bridge/worker)

  • New enrollTokenList store op on both stores (Durable Object SQL + MemoryStore), returning minted-token rows without the hash. State is folded from the row: pending / used (closed by the exchange) / expired (closed by the clock) / revoked (closed by the owner), with the mint binding (agent, kind, groups, notes_identity) and mint/expiry times.
  • Routes: GET /api/<owner>/enroll-tokens and the read-scope twin GET /fleet/<credential>/enroll-tokens. Mint and revoke stay owner-only; the shared fleet token and non-read credentials get 404.
  • The enroll revoke route now also accepts {agent}: revokes every still-pending token for that agent, counted. The console list deliberately shows no hash, so the console revokes by name; the {bootstrap_token | token_hash} forms stand. Used tokens are untouched (they became credentials); expired ones keep their state.

fleet-bridge CLI (pkgs/fleet/crates/fleet-bridge)

  • New central verbs: mint-enroll, enroll-tokens, revoke-enroll (exactly one of --agent / --token-hash, checked before any credential is resolved), mint-credential (scopes, optional service:<name> addr). Book: pkgs/fleet/book/reference/bridge.md gained the four verb sections.

Console (pm-stack/console)

  • Ops methods enrollTokens, mintEnrollToken (validates names, ≤16 groups, TTL 60–604800 before anything runs), revokeEnrollTokens (by agent), mintCredential (scopes ⊆ inbox/send/read; a service addr must be the agent's own name).
  • platformRead section enroll-tokens; the edge bridgeCall translates only enroll-tokens to the PM credential's read route — mints and revoke-enroll are never translated there. Actions: agent.mint-enroll, agent.mint-credential, agent.revoke-enroll.
  • Agents screen gains a Provisioning section: New agent form → mint → a hand-off card showing the token and the exact fleet agent enroll --name <name> --kind <kind> [--groups …] --bootstrap <token> command, with copy buttons and a Hide button; New credential form → same show-once card; per-token state list with closing time and what closed it, plus a Take back button on pending tokens. S8's roster Revoke is reused untouched.

Show-once (the security bar)

The two mints are never HOLDABLE and never device-kept: a mint's answer is the secret, so holding it would lose it. Their audit records name only the binding, never the value. agent.revoke-enroll is HOLDABLE (no value in it), subject enroll:<agent>. A minted value lives only in the action result and the hand-off card's DOM node — never in Ops state, docs sections, audit, outbox, or argv/stdin — and any redraw (leaving the screen, refresh) removes it. Worker-side storage stays hash-only (S3 invariant unchanged).

Deliberate non-change: enroll tokens still mint the exchange credential with S3's fixed scopes (inbox, send); scoped mints are the direct mint-credential path, per design §4.5. No new dependencies.

Verification (remote only, fleet-command workflow on developing-today/fleet)

  • Worker: run 45445395859, Target HEAD 0bc58a967 — 119 tests, 119 pass, 0 fail (baseline 114). New tests in test/provisioning.test.mjs, all passing by name: "the list shows each minted token's state and closing time, and never a hash or a value"; "the console path: a token minted for one name enrolls that name only, and the list follows it"; "revoking by agent name takes back that agent's pending tokens and no others"; "the read scope sees the same state list; plainer doors stay shut, and revoking stays the owner's"; "the Durable Object's SQL folds the same states, hash-free (store parity)".
  • Console: run 45444400375, Target HEAD a7ce18947 (later commits touched only worker/fleet-bridge files) — 654 pass / 0 fail, 26 files (baseline 653). New test: "provisioning: a mint's value reaches the caller once and is kept nowhere" — asserts the value is absent from console state, audit, and every recorded argv/stdin, the HOLDABLE split, and validation refusals before anything runs; plus edge/direct coverage that enroll-tokens reads through the PM credential while mints are refused at the edge.
  • fleet-bridge: run 45447486093, Target HEAD 5053555627b280a2f08b03654ced05901892b44b — 19 passed, 0 failed, command outcome success. New test provisioning_verb_shapes (all four verbs' method/URL/body shapes) passing by name, with every_verb_has_its_own_help and usage_errors_exit_2_before_any_request extended for the new verbs.

Note: the worker/console/bridge runs' GitHub conclusions read "cancelled" where the lane cancelled the run after its Execute step completed, to release the full log from the known Post-Execute hang; each log carries the command's own outcome=success marker and the counts above.

Left open

  • The book's pre-existing gap: S6/S8 central verbs (work, pipeline, directory, credentials, revoke) were already undocumented in reference/bridge.md before this slice.
  • Live rollout rides with the S7 steps (deploy worker → mint vault secret → deploy edge).
{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T17:27:12Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/issue-14376/wt",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/issue-14376/wt",
      "repo": "developing-today/code",
      "branch": "felix/14376-console-provisioning",
      "sha": "5053555627b280a2f08b03654ced05901892b44b"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

felix added 3 commits November 24, 2026 17:03
… shown once, token state, revoke by agent

Worker: GET enroll-token state list (owner route + read-scope
credential route) over a new enrollTokenList store op on both
stores; states pending/used/expired/revoked folded with their
closing times, never a hash or value. Revoke-by-agent on the enroll
revoke route (the console's form: its list shows no hash); the
hash/value forms stand.

fleet-bridge: mint-enroll, enroll-tokens, revoke-enroll
(--agent | --token-hash), mint-credential central verbs.

Console: Agents screen gains Provisioning — new-agent enroll mint
(token + exact enroll command shown once, in the DOM only, never
in state/audit/outbox), direct credential mint (scopes, service
binding), per-agent token state list, take-back of unused tokens.
Mints are never HOLDABLE (their answer is the secret); the enroll
revoke is, like agent.revoke. Edge reads enroll-tokens through the
PM credential; the provisioning verbs are never translated there.

Book: reference/bridge.md gains the four verbs.
…credential-address mint refusal with the console views' 405
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 13185449-3fcd-4948-93db-49eb1d422ebc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants